package com.xhlj.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

/**
 * 帖子表
 * @TableName post
 */
@TableName(value ="post")
public class Post implements Serializable {
    /**
     * 帖子id
     */
    @TableId(type = IdType.AUTO)
    private Integer postId;

    /**
     * 帖子标题
     */
    private String postTitle;

    /**
     * 帖子内容
     */
    private String postContent;

    /**
     * 发帖人
     */
    private Integer userId;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 是否为转发
     */
    private Integer isOriginal;

    /**
     * 帖子的浏览量
     */
    private Integer views;

    /**
     * 帖子的点赞量
     */
    private Integer likes;

    /**
     * 热度
     */
    private Double heatLevel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 帖子id
     */
    public Integer getPostId() {
        return postId;
    }

    /**
     * 帖子id
     */
    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    /**
     * 帖子标题
     */
    public String getPostTitle() {
        return postTitle;
    }

    /**
     * 帖子标题
     */
    public void setPostTitle(String postTitle) {
        this.postTitle = postTitle;
    }

    /**
     * 帖子内容
     */
    public String getPostContent() {
        return postContent;
    }

    /**
     * 帖子内容
     */
    public void setPostContent(String postContent) {
        this.postContent = postContent;
    }

    /**
     * 发帖人
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 发帖人
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 创建时间
     */
    public Date getCreatedTime() {
        return createdTime;
    }

    /**
     * 创建时间
     */
    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    /**
     * 是否为转发
     */
    public Integer getIsOriginal() {
        return isOriginal;
    }

    /**
     * 是否为转发
     */
    public void setIsOriginal(Integer isOriginal) {
        this.isOriginal = isOriginal;
    }

    /**
     * 帖子的浏览量
     */
    public Integer getViews() {
        return views;
    }

    /**
     * 帖子的浏览量
     */
    public void setViews(Integer views) {
        this.views = views;
    }

    /**
     * 帖子的点赞量
     */
    public Integer getLikes() {
        return likes;
    }

    /**
     * 帖子的点赞量
     */
    public void setLikes(Integer likes) {
        this.likes = likes;
    }

    /**
     * 热度
     */
    public Double getHeatLevel() {
        return heatLevel;
    }

    /**
     * 热度
     */
    public void setHeatLevel(Double heatLevel) {
        this.heatLevel = heatLevel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Post other = (Post) that;
        return (this.getPostId() == null ? other.getPostId() == null : this.getPostId().equals(other.getPostId()))
                && (this.getPostTitle() == null ? other.getPostTitle() == null : this.getPostTitle().equals(other.getPostTitle()))
                && (this.getPostContent() == null ? other.getPostContent() == null : this.getPostContent().equals(other.getPostContent()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
                && (this.getIsOriginal() == null ? other.getIsOriginal() == null : this.getIsOriginal().equals(other.getIsOriginal()))
                && (this.getViews() == null ? other.getViews() == null : this.getViews().equals(other.getViews()))
                && (this.getLikes() == null ? other.getLikes() == null : this.getLikes().equals(other.getLikes()))
                && (this.getHeatLevel() == null ? other.getHeatLevel() == null : this.getHeatLevel().equals(other.getHeatLevel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPostId() == null) ? 0 : getPostId().hashCode());
        result = prime * result + ((getPostTitle() == null) ? 0 : getPostTitle().hashCode());
        result = prime * result + ((getPostContent() == null) ? 0 : getPostContent().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getIsOriginal() == null) ? 0 : getIsOriginal().hashCode());
        result = prime * result + ((getViews() == null) ? 0 : getViews().hashCode());
        result = prime * result + ((getLikes() == null) ? 0 : getLikes().hashCode());
        result = prime * result + ((getHeatLevel() == null) ? 0 : getHeatLevel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", postId=").append(postId);
        sb.append(", postTitle=").append(postTitle);
        sb.append(", postContent=").append(postContent);
        sb.append(", userId=").append(userId);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", isOriginal=").append(isOriginal);
        sb.append(", views=").append(views);
        sb.append(", likes=").append(likes);
        sb.append(", heatLevel=").append(heatLevel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}